// CXString.h
#pragma once
#include <string>
#include <vector>

namespace CXLib {
    template<typename T>
    class CXString {
    public:
        using StringType = std::basic_string<T>;

        explicit CXString(const T* str) : str(str) {}

        std::vector<StringType> split(const StringType& delimiter) {
            std::vector<StringType> result;
            StringType s(str);
            size_t pos = 0;
            while ((pos = s.find(delimiter)) != StringType::npos) {
                result.push_back(s.substr(0, pos));
                s.erase(0, pos + delimiter.length());
            }
            result.push_back(s);
            return result;
        }

    private:
        StringType str;
    };
}


